package com.demo.animal;

import com.demo.MyAnimal;
import com.spring.annotation.AutoWired;
import com.spring.annotation.Component;
import com.spring.annotation.PostConstruct;

/**
 * @author chengjy
 * @date 2025/4/7
 */

@Component
public class Cat  implements MyAnimal {
//    @AutoWired
    private Dog dog;

    public Cat(Dog dog) {
        this.dog = dog;
    }

    @PostConstruct
    public void say() {
        System.out.println("我有一只"+ dog.describe());
    }
    @Override
    public String describe() {
        return "丧彪猫";
    }
}
